package com.janlei.acc.proxy.staticProxy;

/**
 * 静态代理
 */
public class StaticProxyStu {
}

/**
 * teacher接口
 */
interface ITearcher {
    void teach();
}

/**
 * 需要被代理的teacher
 */

class Teacher implements ITearcher {

    @Override
    public void teach() {
        System.out.println("teacher teach");
    }
}

/**
 * teacher代理类
 */
class TeacherProxy implements ITearcher {

    private final ITearcher targert;

    public TeacherProxy(ITearcher targert) {
        this.targert = targert;
    }

    @Override
    public void teach() {
        System.out.println("TeacherProxy proxy begin");
        targert.teach();
        System.out.println("TeacherProxy proxy end");
    }
}